//
//  UILabel+Extension.swift
//  WQ_Tools
//
//  Created by 张德华 on 7/21/16.
//  Copyright © 2016 ZhangDeHua. All rights reserved.
//

import UIKit

extension UILabel {
    
    ///  创建label
    ///
    ///  - parameter text:      text
    ///  - parameter fontSize:  fontSize 默认 14
    ///  - parameter textColor: textColor 默认 darkGrayColor
    ///  - parameter alignment: alignment 默认 左对齐
    ///
    ///  - returns: UILabel
    convenience init(wq_text text: String,
                             fontSize: CGFloat = 14,
                             textColor: UIColor = UIColor.darkGrayColor(),
                             alignment: NSTextAlignment = .Left) {
        
        
        self.init()
        
        self.text = text
        self.font = UIFont.systemFontOfSize(fontSize)
        self.textColor = textColor
        self.textAlignment = alignment
        
        numberOfLines = 0
        
        sizeToFit()
    }
    
}
